﻿/*
 *	(*^。^*) TFrameWork License (*^。^*)
 */

/*
 *  Title :
 *
 *  Description :
 *
 *
 *  Date :
 *
 *  Author : DengPing
 *
 *  Modify :
 */
using UnityEngine;

namespace TFrameWork.Module.ActionEditor
{
    public static class Matrix4x4Extend
    {
        public static Quaternion GetRotation(this Matrix4x4 mat)
        {
            Quaternion quaternion = Quaternion.LookRotation(mat.GetColumn(2), mat.GetColumn(1));
            return quaternion;
        }

        public static Vector3 GetScale(this Matrix4x4 mat)
        {
            var scale = new Vector3(
                mat.GetColumn(0).magnitude,
                mat.GetColumn(1).magnitude,
                mat.GetColumn(2).magnitude);
            return scale;
        }
    }
}
